<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
#div1 {width:200px; height:150px; border:1px solid black;}
</style>
<script>
window.onload=function ()
{
	var oTxt=document.getElementById('txt1');
	var oBtn=document.getElementById('btn1');
	var oDiv=document.getElementById('div1');
	
	oBtn.onclick=function ()
	{
		oDiv.innerHTML=oTxt.value;
		//alert(oDiv.innerHTML);
	};
};
</script>
</head>

<body>
<input id="txt1" type="text" />
<input id="btn1" type="button" value="设置文字" />
<div id="div1">
</div>
</body>
</html>
